﻿#region License

// Droid Manager - An Android Phone Tools Suite
// Copyright (C) 2011
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>.

#endregion

using DroidManager.Android.Aapt;
using DroidManager.Data;
using DroidManager.Data.Utils;
using DroidManager.Log;
using DroidManager.Plugins.Interfaces;

namespace DroidManager.Plugins.API
{
    /// <summary>
    /// Plugins Api
    /// </summary>
    public static class Api
    {
        /// <summary>
        /// Returns Aapt Handler Object
        /// Used to read Apk Info
        /// </summary>
        public static AaptHandler AaaptHandler
        {
            get { return AaptHandler.Instance; }
        }

        /// <summary>
        /// Creates and/or manages a new Ini File using Droid Manager's lib
        /// </summary>
        /// <param name="filePath">New Ini File path</param>
        /// <returns><see cref="IniFile">IniFile</see></returns>
        public static IniFile NewIni(string filePath)
        {
            return new IniFile(filePath);
        }

        /// <summary>
        /// Automatically returns IniFile object for Plugin Settings file
        /// </summary>
        /// <param name="plugin">Your plugin instance</param>
        /// <returns><see cref="IniFile">IniFile</see></returns>
        public static IniFile SettingsFile(IPlugin plugin)
        {
            return new IniFile(string.Format("{0}\\{1}.ini", GlobalVars.PluginSettingsPath, plugin.Name));
        }

        /// <summary>
        /// Returns path of ini setting sfile for plugin
        /// </summary>
        /// <param name="plugin">Your plugin instance</param>
        /// <returns>String</returns>
        public static string SettingsFilePath(IPlugin plugin)
        {
            return string.Format("{0}\\{1}.ini", GlobalVars.PluginSettingsPath, plugin.Name);
        }

        /// <summary>
        /// Returns Adb Exe File Path
        /// </summary>
        public static string AdbPath
        {
            get { return GlobalVars.AdbFilePath; }
        }

        /// <summary>
        /// Returns <see cref="Logger">Logger</see> object
        /// </summary>
        public static Logger Logger
        {
            get { return Logger.Instance; }
        }
    }
}